home *** CD-ROM | disk | FTP | other *** search
/ Aminet 28 / Aminet 28 (1998)(GTI - Schatztruhe)[!][Dec 1998].iso / Aminet / dev / amos / intuiextend16.lha / bonus / easylife / demos / FONT_NUM.AMOS / FONT_NUM.amosSourceCode
AMOS Source Code  |  1992-02-26  |  683b  |  47 lines

  1. 'Easylife Example Program
  2. '========================
  3. '
  4. '
  5. 'The procedure FONT_NUM returns the font number of the 
  6. 'given fontname & size, and prevents that being removed
  7. 'from memory.
  8. '
  9. '0 is returned if the font cannot be accessed. 
  10. '
  11. '
  12. '
  13. '
  14. '
  15. Procedure FONT_NUM[NAME$,SIZE]
  16. '
  17. '
  18. On Error Goto FONT_NUM_ERROR
  19. '
  20. REALSIZE$=Mid$(Str$( Extension_16_0498(NAME$,SIZE))+" ",1,3)
  21. Get Rom Fonts : A=0
  22. Repeat 
  23.    Inc A
  24. Until(Mid$(Font$(A),1,Len(NAME$))=NAME$) and(Mid$(Font$(A),30,3)=REALSIZE$)
  25. Goto FONT_NUM_RESUME
  26. '
  27. '
  28. FONT_NUM_ERROR:
  29. A=0
  30. Resume FONT_NUM_RESUME
  31. '
  32. '
  33. FONT_NUM_RESUME:
  34. End Proc[A]
  35. '
  36. '
  37. '
  38. '
  39. '
  40. '
  41. '
  42. 'Example Program:
  43. '
  44. '
  45. FONT_NUM["Times.font",18]
  46. Set Font Param
  47. Text 0,40,"Hello World"